Module: DataModel | .\src\TW\Database\DataModel.py | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Components for database record handling, caching, etc.Example usage: class myDatabase(DataModel.Database): class Family1(DataModel.TypeManager): class SomeTypeA1(DataModel.RecordType): allKeys = ( ('primary_key',), ('secondary_key_field1','secondary_key_field2'), ... ) class SomeTypeB1(SomeTypeA1): ... class SomeTypeC1(DataModel.RecordType): ... class Family2(DataModel.TypeManager): ... You may nest as many families in a database as you want, and as many record types in a family as you want. All record types in a family share the same class for record objects, and the same record cache, indexed by their combined key fields. Record types may derive from one another, within the same type family.
|